package domain.controller;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import domain.service.Utils;

@SuppressWarnings("serial")
public class TrackIpIndexServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.setCharacterEncoding("utf-8");
		Date date_cache = new Date(new Date().getTime()+60*60*1000);
		
		resp.setHeader( "Cache-Control", "public, max-age=30");
		resp.setHeader( "Expires", date_cache.toGMTString() );
		req.setAttribute("title", "Track Ip -  "+Utils.ValidDomain());
		req.setAttribute("description", "Track ip. "+Utils.ValidDomain()+" - search, ip lookup information on  "+Utils.ValidDomain());
		req.setAttribute("keyword", "ip,ip address,track ip,lookup ip");
		try {
			req.getRequestDispatcher("/track_ip_index.jsp").forward(req, resp);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
